﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace DustObjects {
    public class Units {
        public Color Color = Color.TransparentWhite;
        public int Tanks;
        public int Mechs;
        public int Fighters;
        public int Bombers;
        public int Submarines;
        public bool Production;

        public Units() {
        }

        /// <summary>
        /// définir le nombre d'unité de base par joueur
        /// </summary>
        public void Initialize() {
            Tanks = 60;
            Mechs = 20;
            Fighters = 20;
            Bombers = 15;
            Submarines = 15;
            Production = false;
        }
        public void Clear() {
            Tanks = 0;
            Mechs = 0;
            Fighters = 0;
            Bombers = 0;
            Submarines = 0;
            Production = false;
        }

        public bool Empty {
            get {
                bool result = true;
                if (Tanks + Mechs + Fighters + Bombers + Submarines > 0)
                    result = false;

                return result;
            }
        }

        public override string ToString() {
            string output = string.Format("Tanks:{0}\r\n" +
                "Mechs:{1}\r\n" +
                "Fighters:{2}\r\n" +
                "Bombers:{3}\r\n" +
                "Submarines:{4}\r\n" +
                "Production:{5}\r\n", Tanks, Mechs, Fighters, Bombers, Submarines, Production);

            return output;
        }
    }
}
